<{include file="public/header.html"}> 
		<script src="/static/public/jquery.datetimepicker.js"></script>
                <link rel="stylesheet" type="text/css" href="/static/public/jquery.datetimepicker.css">
		<script src="/static/public/jquery.pagination.js" type="text/javascript" charset="utf-8"></script>
		<!--main部分-->
		<div class="x-main-upper w1180-con">
			<!--main--左边--logo/tab-->
			<{include file="public/user_nav.html"}> 
				<!--main--右边--banner-->
				<div class="main-right">
					<div class="mright-content">
						<!--头像、昵称、等级-->
						<{include file="public/user_top.html"}> 		
						<div class="clear"></div>
						<!--溜溜币提现记录-->
						<div class="cash66 mt15">
							<!--title-->
							<div class="title">
								<div class="vertical"></div><p class="title66">我的提现记录</p>
								<!--日期选择-->
							</div>
							<!--溜溜币提现记录title-->
							<div class="choice-code mt15">
                                                            <select class="fl" id="cash_status">
								  <option value="0" selected="selected">全部</option>
								  <option value="1">已支付</option>
								  <option value="2">申请中</option>
								  <option value="3">失败</option>
								</select>
								<div class="fr">
									<div class="date fl">起始日期</div>	
                                                                        <input type="text" id="cash_start_date" class="date_picker" readonly="readonly" placeholder="点击选择日期" value=""/>
									-
                                                                        <input type="text" id="cash_end_date" class="date_picker" readonly="readonly" placeholder="点击选择日期" value="<{$end_time}>"/>
								</div>						
							</div>
							<div class="clear"></div>
							<!--溜溜币提现记录content-->
							<div class="cash-code mt15">
								<table class="code">
									<tr>
										<th>收款人</th>
										<th>到帐金额</th>
										<th>消耗值</th>
										<th>手续费</th>
										<th>收款帐号</th>
										<th>申请日期</th>
										<th>状态</th>
										<th width="10%">备注</th>
									</tr>
									<tbody id="cash_content">
                                                                        </tbody>										
								</table>
								<!-- 页码navigation holder -->
								<div class="holder" id="cash_pagination"></div>	
                                                                <script type="text/javascript">
                                                                    $(function(){
                                                                        showCashPage(0);
                                                                        $("#cash_status").change(function(){
                                                                            showCashPage(0);
                                                                        });
                                                                        $('#cash_start_date').datetimepicker({
                                                                            format:'Y-m-d',
                                                                            closeOnDateSelect: true,
                                                                            lang:'zh',
                                                                            timepicker:false,
                                                                            onChangeDateTime:function(){
                                                                                showCashPage(0);
                                                                            },onShow:function( ct ){
                                                                                this.setOptions({
                                                                                    maxDate:$('#cash_end_date').val()?$('#cash_end_date').val():false
                                                                                })
                                                                            }
                                                                        });
                                                                        $('#cash_end_date').datetimepicker({
                                                                            format:'Y-m-d',
                                                                            closeOnDateSelect: true,
                                                                            lang:'zh',
                                                                            timepicker:false,
                                                                            onChangeDateTime:function(){
                                                                                showCashPage(0);
                                                                            },onShow:function( ct ){
                                                                                this.setOptions({
                                                                                    maxDate:$('#cash_start_date').val()?$('#cash_start_date').val():false
                                                                                })
                                                                            }
                                                                        });
                                                                        
                                                                    });
                                                                    function handleCashPage(resp){
                                                                        var str = "";
                                                                        var totalCount = resp.data.totalCount;
                                                                        var list = resp.data.list;
                                                                        if(totalCount == 0){
                                                                            str += "<tr><td colspan='8'><img width='120px' src='..<{$style_dir}>/img/no-trade.png'/></td></tr>"
                                                                        }
                                                                        
                                                                        $.each(list,function(index,data){
                                                                            var status = "";
                                                                            if(data.status == 1){status = "<td class='green'>已支付</td>";}else if(data.status == 2){status = "<td class='orange'>申请中</td>";}else{status = "<td class='orange'>失败</td>";}
                                                                            str += "<tr><td>"+data.name+"</td><td class='green'>￥"+data.true_amount+"</td><td class='orange'>"+data.finance+"</td><td>￥"+data.fee+"</td><td>"+data.account+"("+data.type+")</td><td>"+data.create_time+"</td>"+status+"<td>"+data.remark+"</td></tr>";
                                                                        });
                                                                        $("#cash_content").html(str);
                                                                        cashPage(totalCount,resp.data.pageIndex);
                                                                    }
                                                                    function showCashPage(pageIndex,jq){
                                                                        var params = {};
                                                                        var status = $("#cash_status").val();
                                                                        var start_date = $("#cash_start_date").val();
                                                                        var end_date = $("#cash_end_date").val();
                                                                        params.start_date = start_date != "" ? start_date : "";
                                                                        params.end_date = end_date != "" ? end_date : "";
                                                                        params.pageIndex = pageIndex;
                                                                        params.status = status;
                                                                        doPageRequest("/user/cash_list.html",params,false,handleCashPage,errorCallback);
                                                                    }
                                                                    
                                                                    function cashPage(total,pageIndex){
                                                                        $("#cash_pagination").pagination(total, { //recordCount在后台定义的一个公有变量，通过从数据库查询记录进行赋值，返回记录的总数
                                                                        callback: showCashPage,  //点击分页时，调用的回调函数
                                                                        prev_text: '<',  //显示上一页按钮的文本
                                                                        next_text: '>',  //显示下一页按钮的文本
                                                                        link_to:"javascript:void(0);",
                                                                        items_per_page:5,  //每页显示的项数
                                                                        num_display_entries:6,  //分页插件中间显示的按钮数目
                                                                        current_page:pageIndex,  //当前页索引
                                                                        num_edge_entries:2  //分页插件左右两边显示的按钮数目
                                                                        });
                                                                    }
                                                                </script>
							</div>
						</div>
                                                <div class="cash66 mt15">
							<!--title-->
							<div class="title">
                                                            <div class="vertical"></div><p class="title66" id="shop">商品兑换记录</p>
							</div>
							<div class="choice-code mt15">
                                                            <select class="fl" id="exchange_status">
								  <option value="0" selected="selected">全部</option>
								  <option value="1">已兑换</option>
								  <option value="2">申请中</option>
								  <option value="3">失败</option>
								</select>
								<div class="fr">
									<div class="date fl">起始日期</div>	
                                                                        <input type="text" id="exchange_start_date" class="date_picker" placeholder="点击选择日期" readonly="readonly"/>
									-
                                                                        <input type="text" id="exchange_end_date" class="date_picker" placeholder="点击选择日期" readonly="readonly" value="<{$end_time}>"/>
								</div>			
							</div>	
							<div class="clear"></div>
							<!--商品兑换记录content-->
							<div class="cash-code mt15">
								<table class="code">
									<tr>
										<th>商品名称</th>
										<th>消耗溜溜币</th>
										<th>兑换人信息</th>
										<th>兑换时间</th>
										<th>兑换状态</th>
										<th width="15%">备注</th>
									</tr>									
									<tbody id="exchange_content">
									</tbody>									
								</table>
								<!-- 页码navigation holder -->
                                                                <div class="holder" id="exchange_pagination"></div>	
                                                                <script type="text/javascript">
                                                                    $(function(){
                                                                        showExchangePage(0);
                                                                        $("#exchange_status").change(function(){
                                                                            showExchangePage(0);
                                                                        });
                                                                        $('#exchange_start_date').datetimepicker({
                                                                            format:'Y-m-d',
                                                                            closeOnDateSelect: true,
                                                                            lang:'zh',
                                                                            timepicker:false,
                                                                            onChangeDateTime:function(){
                                                                                showExchangePage(0);
                                                                            },onShow:function( ct ){
                                                                                this.setOptions({
                                                                                    maxDate:$('#exchange_end_date').val()?$('#exchange_end_date').val():false
                                                                                })
                                                                            }
                                                                        });
                                                                        $('#exchange_end_date').datetimepicker({
                                                                            format:'Y-m-d',
                                                                            closeOnDateSelect: true,
                                                                            lang:'zh',
                                                                            timepicker:false,
                                                                            onChangeDateTime:function(){
                                                                                showExchangePage(0);
                                                                            },onShow:function( ct ){
                                                                                this.setOptions({
                                                                                    maxDate:$('#exchange_start_date').val()?$('#exchange_start_date').val():false
                                                                                })
                                                                            }
                                                                        });
                                                                        
                                                                    });
                                                                    function handleExchangePage(resp){
                                                                        var str = "";
                                                                        var totalCount = resp.data.totalCount;
                                                                        var list = resp.data.list;
                                                                        if(totalCount == 0){
                                                                            str += "<tr><td colspan='8'><img width='120px' src='..<{$style_dir}>/img/no-trade.png'/></td></tr>"
                                                                        }
                                                                        
                                                                        $.each(list,function(index,data){
                                                                            var status = "";
                                                                            var stemp = "";
                                                                            if(data.status == 1){status = "<td class='green'>已兑换</td>";}else if(data.status == 2){status = "<td class='orange'>申请中</td>";}else{status = "<td class='orange'>失败</td>";}
                                                                            if(data.type == 1){stemp += "<td>【详情】："+data.name+"，"+data.phone+","+data.address+"</td>";}else{stemp += "<td>【充值账号】："+data.account+"</td>";}
                                                                            str += "<tr><td>"+data.title+"</td><td class='orange'>"+data.amount+"</td>"+stemp+"<td>"+data.create_time+"</td>"+status+"<td>"+data.remark+"</td></tr>";
                                                                        });
                                                                        $("#exchange_content").html(str);
                                                                        exchangePage(totalCount,resp.data.pageIndex);
                                                                    }
                                                                    function showExchangePage(pageIndex,jq){
                                                                        var params = {};
                                                                        var status = $("#exchange_status").val();
                                                                        var start_date = $("#exchange_start_date").val();
                                                                        var end_date = $("#exchange_end_date").val();
                                                                        params.start_date = start_date != "" ? start_date : "";
                                                                        params.end_date = end_date != "" ? end_date : "";
                                                                        params.pageIndex = pageIndex;
                                                                        params.status = status;
                                                                        doPageRequest("/user/exchange_list.html",params,false,handleExchangePage,errorCallback);
                                                                    }
                                                                    
                                                                    function exchangePage(total,pageIndex){
                                                                        $("#exchange_pagination").pagination(total, { //recordCount在后台定义的一个公有变量，通过从数据库查询记录进行赋值，返回记录的总数
                                                                        callback: showExchangePage,  //点击分页时，调用的回调函数
                                                                        prev_text: '<',  //显示上一页按钮的文本
                                                                        next_text: '>',  //显示下一页按钮的文本
                                                                        link_to:"javascript:void(0);",
                                                                        items_per_page:5,  //每页显示的项数
                                                                        num_display_entries:6,  //分页插件中间显示的按钮数目
                                                                        current_page:pageIndex,  //当前页索引
                                                                        num_edge_entries:2  //分页插件左右两边显示的按钮数目
                                                                        });
                                                                    }
                                                                </script>
							</div>									
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="clear"></div>
		<!--footer-->
                <!--页码-->
<!--                <script src="<{$style_dir}>/js/jPages.js" type="text/javascript" charset="utf-8"></script>
 		<script type="text/javascript">
			$(function(){
			/* initiate plugin */
				$(".holder").jPages({
					containerID : "itemContainer",
					clickStop   : true
				});
			});
		</script>		-->
<{include file="public/footer.html"}> 			